'use strict';

module.exports = app => {
    class TeachingtaskController extends app.Controller {

        //题库管理主页
        async tasks() {
            if('GET' == this.ctx.request.method){
                const data = await this.service.teachingtask.getinformation();
                await this.ctx.render("/teaching/tasks/tasks.html",{data});
            }else{
                const params = this.ctx.request.body;
                const data = await this.service.teachingtask.delinformation(params);
                this.success();
            }

        };

        //增加题目
        async addtask() {
            const data = await this.service.teaching.teaching();
            await this.ctx.render("/teaching/tasks/add-task.html");
        };

        //题目增加完成页面
        async tasksucceed(){
            const data = await this.service.teaching.teaching();
            await this.ctx.render("/teaching/tasks/add-task-succeed.html");
        };
    }
    return TeachingtaskController;
};

